package com.ciwong.epaper.modules.epaper.adapter;

import android.view.View;
import android.widget.TextView;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.epaper.bean.Grade;
import com.ciwong.epaper.modules.me.adapter.BaseCommonAdapter;

import java.util.List;

/**
 * @description: 配音下拉框适配器
 * @author: wyk
 * @time: 2024/6/7 10:25
 */
public class DubReGradeSpinnerAdapter extends BaseCommonAdapter {

    public DubReGradeSpinnerAdapter(List<Grade> dataList) {
        super(dataList);
    }

    @Override
    public int getItemResId(int position) {
        return R.layout.item_grade_zhuanji;
    }

    @Override
    public Object createViewHolder(View convertView, int position) {
        DubReGradeSpinnerAdapter.ViewHolder viewHolder = new DubReGradeSpinnerAdapter.ViewHolder();
        viewHolder.tv_zhuanji_word = (TextView) convertView.findViewById(R.id.tv_zhuanji_word);

        return viewHolder;
    }

    @Override
    public void showData(Object bean, Object holder, int position) {
        DubReGradeSpinnerAdapter.ViewHolder viewHolder = (DubReGradeSpinnerAdapter.ViewHolder) holder;
        Grade grade = (Grade) bean;
        viewHolder.tv_zhuanji_word.setText(grade.getGradeName());
    }

    private class ViewHolder {
        public TextView tv_zhuanji_word;
    }
}
